{% extends "base.html" %}

{% block content %}
<div class="py-5">
    <div class="container">
        <div class="row">
            <div class="col-12">
                <h2>罚单</h2>
                <hr class="mb-4">
            </div>
        </div>
        {% if is_empty %}
        <h4>您没有罚单</h4>
        {% else %}
        <div class="row">
            <div class="col-md-12 p-3">
                <table class="table table-hover table-striped table-bordered">
                    <thead class="thead-inverse">
                        <tr>
                            <th scope="col">描述</th>
                            <th scope="col">金额</th>
                            <th scope="col">时间</th>
                            <th scope="col">状态</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for ticket in tickets %}
                        <tr>
                            <td>{{ ticket.description }}</td>
                            <td>{{ ticket.price }}</td>
                            <td>{{ ticket.time }}</td>
                            <td>
                                {% if ticket.state == 0 %}
                                <a href="{% url 'ticket_handle' ticket.id %}">待处理</a>
                                {% else %}
                                已完成
                                {% endif %}
                            </td>
                        </tr>
                        {% endfor %}
                    </tbody>
                </table>
            </div>
        </div>
        {% endif %}
    </div>
</div>
{% endblock %}